const qs = require('qs')
interface User {
    name: string,
    age: number,
    sex: string,
    avatar: string
}

interface returnInfo {
    code: number,
    msg: string,
    data: Object
}

const userInfo: User = {
    name: 'bonnie',
    age: 18,
    sex: '男',
    avatar: 'https://img.chinasongzhuang.cn/uploadimg/image/20200219/20200219180104_83804.jpg'
}



const userInterface = (req: any): returnInfo => {
    const params = qs.parse(req.url.split('?')[1])
    console.log('个人信息 传递的参数是 ', params)
    return {
        code: 0,
        msg: 'success',
        data: userInfo
    }
}

export default userInterface